package wisents.wicket.form.submitingstrategy;

import wisents.api.FormRepresentation;

public class WicketButtonFormSubmittingStrategy implements WicketFormSubmittingStrategy {

    private final String linkRelativePath;

    public WicketButtonFormSubmittingStrategy(String linkRelativePath) {
        this.linkRelativePath = linkRelativePath;
    }

    @Override
    public void submit(FormRepresentation form) {
        new EnhancedWicketFormTesterFactory()
                .createEnhancedFormTester(form)
                .submitWithButton(linkRelativePath);
    }
}
